﻿#region Dont Look This

// /*************************************************************************************
// 
// * 文件名称：  UIManager.cs
// 
// * 作    者：  jieaido@outlook.com
// 
// * 创建日期：  2020/04/12/22:16
// 
// * 修改日期:   2020/04/12/22:16
// 
// * 功能描述：
// 
// 
// 
//                               Copyright (c) Jieaido. AllRights Reserved
// 
// *************************************************************************************/

#endregion

using UnityEngine;
using UnityEngine.UI;

public class UIManager : MonoBehaviour
{
    private GameManager gameManager;

    public GameObject[] Panels;

    public Text TipUItText;
    public Text[] TipUItTexts;

    public UIManager instance { get; set; }

    // 加载脚本实例时调用 Awake
    private void Awake()
    {
        instance = this;
     
    }

    // Start is called before the first frame update
    private void Start()
    {
        gameManager = GameManager.Instance;
        loadGame();
    }

    // Update is called once per frame
    private void Update()
    {
    }

    /// <summary>
    /// </summary>
    public void startLocalMode()
    {
        Panels[0].SetActive(false);
        Panels[1].SetActive(true);
    }

    /// <summary>
    /// </summary>
    public void startNetMode()
    {
        //todo
    }

    /// <summary>
    /// </summary>
    public void QuitGame()
    {
        Application.Quit();
    }

    public void SingleMode()
    {
        Panels[2].SetActive(false);
        Panels[3].SetActive(true);
        gameManager.SetGameMode(0);

    }

    public void DoubleMode()
    {
        Panels[2].SetActive(false);
      
        gameManager.SetGameMode(1);

        loadGame();
    }

    public void LevelOption(int level)
    {
        Panels[3].SetActive(false);
        gameManager.SetGameLevel(level);
        loadGame();
        
    }
    private void loadGame()
    {
        Panels[4].SetActive(true);
        gameManager.ResetGame();
      //  Panels[0].SetActive(true);
        Panels[1].SetActive(false);
        Panels[2].SetActive(true);
        Panels[3].SetActive(false);
        // throw new System.NotImplementedException();
    }
    /// <summary>
    /// 悔棋
    /// </summary>
    public void UnDo()
    {

    }
    /// <summary>
    /// 重玩
    /// </summary>
    public void RePlay()
    {

    }

    /// <summary>
    /// 回主菜单
    /// </summary>
    public void ReMain()
    {

    }
}